<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
		<!--[if IE 7]>
		  <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css" />
		<![endif]-->
		<link rel="stylesheet" href="${ctx}/assets/css/ace.min.css" />
		<link rel="stylesheet" href="${ctx}/assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="${ctx}/assets/css/ace-skins.min.css" />
        <link rel="stylesheet" href="${ctx}/css/style.css"/>
		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="${ctx}/assets/js/ace-extra.min.js"></script>
		<!--[if lt IE 9]>
		<script src="${ctx}/assets/js/html5shiv.js"></script>
		<script src="${ctx}/assets/js/respond.min.js"></script>
		<![endif]-->
		<script src="${ctx}/js/jquery-1.9.1.min.js"></script>        
        <script src="${ctx}/assets/layer/layer.js" type="text/javascript"></script>
<title>失物招领后台登陆</title>
</head>

<body class="login-layout">
<div class="logintop">    
    <span>欢迎后台管理界面平台</span>    
    </div>
    <div class="loginbody">
<div class="login-container">
	<div class="center">
		<h1>
			<i class="icon-leaf green"></i>
			<span class="orange">失物招领</span>
			<span class="white">后台管理系统</span>
		</h1>
		<h4 class="white">Background Management System</h4>
	</div>

	<div class="space-6"></div>

	<div class="position-relative">
		<div id="login-box" class="login-box widget-box no-border visible">
			<div class="widget-body">
				<div class="widget-main">
					<h4 class="header blue lighter bigger">
						<i class="icon-coffee green"></i>
						管理员登陆
					</h4>

					<div class="login_icon"><img src="${ctx}/images/login.png" /></div>

					<form class="">
						<fieldset>
							<label class="block clearfix">
								<span class="block input-icon input-icon-right">
									<input type="text" class="form-control" placeholder="登录名"  name="登录名" id="userName">
									<i class="icon-user"></i>
								</span>
							</label>

							<label class="block clearfix">
								<span class="block input-icon input-icon-right">
									<input type="password" class="form-control" placeholder="密码" name="密码" id="passWord">
									<i class="icon-lock"></i>
								</span>
							</label>

							<div class="space"></div>

							<div class="clearfix">

								<button type="button" class="width-35 pull-right btn btn-sm btn-primary" id="login_btn">
									<i class="icon-key"></i>
									登陆
								</button>
							</div>

							<div class="space-4"></div>
						</fieldset>
					</form>

					<div class="social-or-login center">
						<span class="bigger-110"></span>
					</div>

					<div class="social-login center">
					本网站系统不再对IE8以下浏览器支持，请见谅。
					</div>
				</div><!-- /widget-main -->

				<div class="toolbar clearfix">
					

					
				</div>
			</div><!-- /widget-body -->
		</div><!-- /login-box -->
	</div>
</div>
                  </div>
 <div class="loginbm">版权所有  2017  <a href="">长江师范学院</a> </div><strong></strong>
</body>
</html>
<script>
<!--提示框-->
function alertMsg(titleName,msg){
	layer.alert(msg,{title: titleName,icon:0,}); 
}

if (window != top) {
	top.location.href = location.href;
}

$('#login_btn').on('click', function(){
	
	var userName=$("#userName").val();
	var passWord=$("#passWord").val();
	if(userName==null||userName==""){
		alertMsg("提示框", "用户名不能为空");
		return
	}
	if(passWord==null||passWord==""){
		alertMsg("提示框", "密码不能为空");
		return
	}
	var datas={"userName":userName,"passWord":passWord};
	$.ajax({
		  type: 'POST',
		  url: "${ctx}/user/userInfo?type=login",
		  data: datas,
		  dataType: "json",
		  success: function(data){
			  if(data.returnCode==200){
				  location.href="${ctx}/auth/admin/index";
			  }else{
				  alertMsg("提示框", data.returnMsg);
			  }
		  },error:function(){
			  alertMsg("提示框", "登录失败");
		  }
	});
	
	
	
});

</script>